﻿using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using DevExpress.XtraReports.UI;
using DevExpress.XtraPivotGrid;
using System.Collections.Generic;
using DXApplicationTangche.UC.成品出库单.service;
using System.Data;
using DXApplicationTangche.Utils;
using DevExpress.XtraGrid.Demos.util;
using DXApplicationTangche.UC.订单一览新.订单预览新.service;
using DXApplicationTangche.UC.订单一览新.辅料.service;
using DXApplicationTangche.UC.款式尺寸;
using mendian;
using DXApplicationTangche.DTO;
using DXApplicationTangche.UC.货号管理.service;
using DXApplicationTangche.UC.项目流程.Service;
using DXApplicationTangche.UC.订单一览新.销售确认单;

namespace DXApplicationTangche.report
{
    public partial class XtraReport销售二联凭证 : DevExpress.XtraReports.UI.XtraReport
    {
        private SaleOrderReportDTO saleOrderReportDTO = new SaleOrderReportDTO();
        private List<SaleOrderReportDetailDTO> saleOrderReportDetailDTOs = new List<SaleOrderReportDetailDTO>();

        public XtraReport销售二联凭证(SaleOrderReportDTO saleOrderReportDTO)
        {
            InitializeComponent();
            this.saleOrderReportDTO = saleOrderReportDTO;
            this.saleOrderReportDetailDTOs = saleOrderReportDTO.saleOrderReportDetailDTOS;
            this.BindData();
            this.BindTableData();
        }
        /// <summary>
        /// 绑定表头
        /// </summary>
        private void BindData()
        {
            this.xrTableCell客户姓名.Text = this.saleOrderReportDTO.customerName;
            this.xrTableCell电话.Text = this.saleOrderReportDTO.mobile;
            this.xrTableCell客户地址.Text = this.saleOrderReportDTO.customerAddress;
            this.xrTableCell账户余额.Text = this.saleOrderReportDTO.accountBalance.ToString();
            this.xrTableCell会员类型.Text = this.saleOrderReportDTO.membershipType;
            this.xrTableCell门店.Text = this.saleOrderReportDTO.store;
            this.xrTableCell主销售.Text = this.saleOrderReportDTO.assistant;
            this.xrTableCell下单日期.Text = this.saleOrderReportDTO.orderDate;
            this.xrTableCell打印日期.Text = this.saleOrderReportDTO.printDate;
            //this.xrTableCell金额总计.Text = "";
        }

        private void BindTableData()
        {
            this.xrTableCell数量.DataBindings.Add("Text", DataSource, "quantity");
            this.xrTableCell款式名称.DataBindings.Add("Text", DataSource, "styleNameCn");
            this.xrTableCell面料号.DataBindings.Add("Text", DataSource, "materialCode");
            this.xrTableCell尺码.DataBindings.Add("Text", DataSource, "styleSizeCd");
            this.xrTableCell业务类型.DataBindings.Add("Text", DataSource, "businessType");
            this.xrTableCell付款方式.DataBindings.Add("Text", DataSource, "paymentType");
            this.xrTableCell实付价格.DataBindings.Add("Text", DataSource, "actualPay");
            this.xrTableCell样衣登记价格.DataBindings.Add("Text", DataSource, "salePrice");
            this.xrTableCell订单金额.DataBindings.Add("Text", DataSource, "totalPrice");
            this.xrTableCell商品调价.DataBindings.Add("Text", DataSource, "adjust_price");
            this.xrTableCell设计费.DataBindings.Add("Text", DataSource, "design_price");
            this.xrTableCell成衣条码.DataBindings.Add("Text", DataSource, "barcode");
        }
    }

}
